package com.taoge.controller;

import com.taoge.entity.Department;
import com.taoge.entity.Msg;
import com.taoge.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/dept")
public class DepartmentController {

    @Autowired
    private DepartmentService service;

    @GetMapping("/findAll")
    public Msg findAll(){
        List<Department> list = service.findAll();
        return Msg.success().add("depts",list);
    }

}
